package com.example.aidemo.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

@Document("user")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    @Id //建议一定要有一个字段定义为id,对应到_id
    Long id;
    @Field("username")//该注解可以省略,如果字段名和mongodb中的字段名不一致,才需要指定
    String name;
    Integer age;
    Boolean gender;
    String pwd;
}
